#pragma once
#include <stdint.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp> 
#include<opencv2/highgui/highgui.hpp>
#pragma pack (1)
class FGSFile
{
public :
	FGSFile(void);
	bool Load(const char* pcFileName);
	void SaveTxt(const char* pcFileName);
	void Export(std::string dir);

	struct Info
	{
		uint32_t contentSize; // 2 8
		unsigned char m_flag; //  12
		uint32_t count; //13
	};

	struct Info2
	{
		union MyUnion
		{
			int32_t value;
			struct MyStruct
			{
				uint8_t m_unKnow1_4;
				uint8_t m_unKnow1_3;
				uint8_t m_unKnow1_2;
				uint8_t m_unKnow1_1;
			} sValue;
		}m_unKnow1;
		int32_t m_unKnow2;
		int32_t m_unKnow3;
		int32_t m_unKnow4;
		int32_t m_unKnow5;
		int32_t m_unKnow6;
		int32_t m_unKnow7;
		int32_t m_unKnow8;
		int32_t m_unKnow9;

		int32_t m_unKnow10;
		int32_t m_unKnow11;
		int32_t size;

		unsigned char pData[];
	};

private:
	Info2** m_unKnow1 = 0; // 0
	void* m_unKnow2 = 0; // 1    4
	Info *m_pInfo = 0; // 2 8
	std::vector<cv::Vec3b> palette;
	std::string m_name;
};

#pragma pack ()